package com.mccrea.pattern.adapter.classadapter;

/**
 * @Classname Phone
 * @Description 手机
 * @Date 2021/5/8 0008 15:17
 * @Created by Mccrea_Gao
 */
public class Phone {
    public void charge(IVoltage5V iVoltage5V) {
        if (iVoltage5V.outPut5V() == 5) {
            System.out.println("电压为5V，可以充电");
        } else if (iVoltage5V.outPut5V() > 5) {
            System.out.println("电压大于5V，无法充电");
        }
    }
}
